package cinema;

import java.io.Serializable;
import java.util.Calendar;
import java.util.GregorianCalendar;

import cinema.Movie.Detail;

/**
 * @authors Matt Couzens & Amanda Kosinski
 * @version 29 April 2012
 */

public class Showing implements Serializable {
	private Movie movie;
	private Screen screen;
	private Calendar showtime;
	private int bookedSeats;

	public Showing(){
	}

	/**
	 * @param movie
	 * @param screen
	 * @param year
	 * @param month
	 * @param date
	 * @param hrs
	 * @param min
	 */
	public Showing(Movie movie, Screen screen, int year, int month, int date, int hrs, int min) {
		this.movie = movie;
		this.screen = screen;
		showtime = new GregorianCalendar(year, month, date, hrs, min);
	}

	/**
	 * @return the movie
	 */
	public Movie getMovie() {
		return movie;
	}

	/**
	 * @param movie the movie to set
	 */
	public void setMovie(Movie movie) {
		this.movie = movie;
	}

	/**
	 * @return the screen
	 */
	public Screen getScreen() {
		return screen;
	}

	/**
	 * @param scr the screen to set
	 */
	public void setScreen(Screen scr) {
		screen = scr;
	}

	/**
	 * @return the showtime
	 */
	public Calendar getShowtime() {
		return showtime;
	}

	/**
	 * @param showtime the showtime to set
	 */
	public void setShowtime(Calendar cal) {
		showtime = cal;
	}
	
	/**
	 * @return the bookedSeats
	 */
	public int getBookedSeats() {
		return bookedSeats;
	}

	/**
	 * @param bookedSeats the bookedSeats to set
	 */
	public void setBookedSeats(int bookedSeats) {
		this.bookedSeats = bookedSeats;
	}

	@Override
	public String toString(){
		return movie.getMovieDetails(Detail.Title) 
				+ " (" + movie.getMovieDetails(Detail.Director) + 
				"), Screen " + screen.getScreenNumber() + ", "
				+ Utility.dateToString(showtime, 1);
	}
}